<script>
import {getAllDepartment} from "@/api/request";

export default {
  name: "department",
  data() {
    return {
      tableData: [
        {
          departId: 1,
          departDetail: ''
        }
      ],
    }
  },
  mounted() {
    getAllDepartment().then(
        res => {
          if (res.data.code === 1) {
            this.tableData = res.data.data
          }
        }
    )
  }
}
</script>

<template>
  <el-container>
    <el-main>
      <el-row>
        <el-col>
          <el-table
              :data="tableData"
              style="width: 100%">
            <el-table-column
                prop="departId"
                label="部门编号"
                width="200">
            </el-table-column>
            <el-table-column
                prop="departDetail"
                label="部门">
            </el-table-column>
          </el-table>
        </el-col>
      </el-row>
    </el-main>
  </el-container>
</template>

<style scoped>
::v-deep .el-table__row {
  background-color: #f9f4e9 !important;
}

::v-deep .el-table th.el-table__cell {
  background-color: #f9f4e9 !important;
}
</style>
